export default {
	namespaced: true,
	
	state:{
		token: uni.getStorageSync("token") || null,                      // token
		isBindMobile: uni.getStorageSync("isBindMobile") || null,        // 用户是否绑定手机号
		userMobile: uni.getStorageSync("userMobile") || null,            // 用户手机号
		nowOpenid: uni.getStorageSync("nowOpenid") || null,            // openid
		userId: uni.getStorageSync("userId") || null,                    // 用户id
		shareuId: uni.getStorageSync("shareuId") || null,                    // 用户id
		Marketid: uni.getStorageSync("Marketid") || null,                    // 卖场id
	},
	
	mutations: {
		// 设置-token
		["SET_token"] (state, payload) { 
			state.token = payload
			uni.setStorageSync("token", payload) 
		},
		// 设置-用户是否绑定手机号
		["SET_isBindMobile"] (state, payload) { 
			state.isBindMobile = payload
			uni.setStorageSync("isBindMobile", payload) 
		},
		// 设置-用户手机号
		["SET_userMobile"] (state, payload) { 
			state.userMobile = payload
			uni.setStorageSync("userMobile", payload)
		},
		// 设置-openid
		["SET_nowOpenid"] (state, payload) { 
			state.nowOpenid = payload
			uni.setStorageSync("nowOpenid", payload)
		},
		// 设置-用户id
		["SET_userId"] (state, payload) { 
			state.userId = payload
			uni.setStorageSync("userId", payload)
		},
		// 设置-分享id
		["SET_shareuId"] (state, payload) { 
			state.shareuId = payload
			uni.setStorageSync("shareuId", payload)
		},
		// 设置-分享id
		["SET_Marketid"] (state, payload) { 
			state.Marketid = payload
			uni.setStorageSync("Marketid", payload)
		},
	}
}